<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:composite="http://java.sun.com/jsf/composite"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
	
	<f:event listener="#{userBean.displaySpecificUserProfileData}" type="preRenderView" />
	
    <h:head>
    </h:head>
	<h:body>
		<p:panel id="UserPanel">
			<c:if test="#{userBean.activeUser!=null}">
				<h:form id="asForm">
					<p:tab id="profileData" title="#{userBean.profileData.lastName}">
					
						<p:panelGrid columns="2" cellpadding="10">
							<h:outputText value="Benutzername: " />
							<h:outputText id="userName"
								value="#{userBean.profileData.username}" style="font-weight: bold" />
							
							<h:outputText value="Profilbild: " />	
						    <p:graphicImage value="#{userBean.profileImage}" width="80" heigth="120" /> 
		
							<h:outputText value="Vorname:" />
							<h:outputText id="firstName"
								value="#{userBean.profileData.firstName}"
								style="font-weight: bold" />
		
							<h:outputText value="Nachname:" />
							<h:outputText id="surName" value="#{userBean.profileData.lastName}"
								style="font-weight: bold" />
		
							<h:outputText value="Ort:" />
							<h:outputText id="city" value="#{userBean.profileData.city}"
								style="font-weight: bold" />
		
							<h:outputText value="Abteilung:" />
							<h:outputText id="department"
								value="#{userBean.profileData.department.name}"
								style="font-weight: bold" />
		
							<h:outputText value="Mail:" />
							<h:outputText id="email" value="#{userBean.profileData.email}"
								style="font-weight: bold" />
		
							<h:outputText value="Raum:" />
							<h:outputText id="roomNumber"
								value="#{userBean.profileData.roomNumber}"
								style="font-weight: bold" />
		
							<h:outputText value="Telefon:" />
							<h:outputText id="telephone"
								value="#{userBean.profileData.telephone}"
								style="font-weight: bold" />
		
							<h:outputText value="Interessen:" />
							<h:outputText id="interests"
								value="#{userBean.profileData.interests}"
								style="font-weight: bold" />
		
							<h:outputText value="Expertisen:" />
							<h:outputText id="expertise"
								value="#{userBean.profileData.expertise}"
								style="font-weight: bold" />
						</p:panelGrid>
						
					</p:tab>
				</h:form>
			</c:if>
			<c:if test="#{userBean.activeUser==null}">
				<h:outputText value="Please login to view user profiles!" />
			</c:if>
		</p:panel>
	</h:body>
</html>